home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
051-075
/
disk_054
/
miditools
/
poster
< prev
next >
Wrap
Text File
|
1992-05-06
|
3KB
|
70 lines
Article 1695 of comp.sys.amiga:
Path: mcdsun!noao!hao!hplabs!pesnta!peora!petsd!fredc
From: fredc@petsd.UUCP (Fred Cassirer)
Newsgroups: comp.sys.amiga
Subject: Play and Record MIDI data
Message-ID: <911@petsd.UUCP>
Date: 25 Jan 87 02:12:38 GMT
Organization: Perkin-Elmer DSG, Tinton Falls, N.J.
Lines: 439
Recently there has been quite a bit of interest in MIDI on the AMIGA.
I have a Yamaha DX-27 and have put together a few programs that will
play and record thru the MIDI I/F. They aren't anything spectacular,
as a matter of fact all they do is play and record, placing the output
in an ASCII hex file (stdout). I hope to add more midi tools to this
collection, maybe this posting will prompt a few more.
What it does:
1) Record - Records midi data and TIMING between midi events and writes it
to stdout. The timing is done using TICKS (60th's of a second)
via the DateStamp AMIGADOS call. To do this I've introduced a
"new" midi message number, #defined as "TIMETAG". All other
data recorded is pure midi data. When a TIMETAG is found in
the stream, a 16 bit value is assumed to follow. I know it's
probably not the best way to do it, but that's the way I did
it.
2) Play - The complement of "Record". Play will take as input the ASCII
hex file created by "Record" and send it out the serial port
(hopefully via a MIDI I/F). Play will interpret the TIMETAG
and wait between the MIDI commands so as to ATTEMPT to reproduce
the original timings.
Under 1.2 you must set your serial port (via pref.) to be 31250 baud. I
am using the 512 byte buffer size, I don't think you need more then this
as the programs are using the lowest level of I/O. The one problem that
could possibly arise is due to the buffering of the serial device. So
far I haven't had any problems, but I think if you were to run a few other
tasks while using play/record, you may cause the serial device to start
buffering it's input. In this case I think the timing's would start to
get out of sync with real-time, since the TIMETAG wouldn't reflect when
the data was actually read (record seems to keep up with the serial device
when there's nothing else going on).
As an aside, I usually run the programs under Matt Dillon's shell, with
the output going to RAM:, haven't tried it with output going directly
to disk, but I would think it may make a difference it how accurate the
timings are, whenever the disk flushes the serial buffer may start to
back up, not sure. I normally run them using a pipe like:
% record | play
and hit ^C to exit the record and start the playback.
Currently I'm working on a composite of both play and record that
allow you to control the entire DX-27 (DX-7 .. 100 etc) from the AMIGA.
I was having some problems getting the DX to send the presets, but I
may have that solved.
If anyone has any problems, I'll try to help, but I'm new at this stuff
too. I'd like to talk to anyone interested in writing midi tools that
can be used together, maybe we can start some kind of a library ...
Fred Cassirer